package com.zxn.dragdemo;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;


public class SplashActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);

        int[] viewIds = {R.id.btn_0, R.id.btn_1, R.id.btn_2};
        for (int viewId : viewIds) {
            findViewById(viewId).setOnClickListener(this::onViewClicked);
        }
    }


    public void onViewClicked(View view) {
        if (view.getId() == R.id.btn_0){
            startActivity(new Intent(this, DragActivity.class));
        }

        if (view.getId() == R.id.btn_1){
            startActivity(new Intent(this, DragSwayActivity.class));
        }

        if (view.getId() == R.id.btn_2){
            startActivity(new Intent(this, MainActivity.class));
        }
    }
}
